import React from 'react';
import './index.css';
import { useNavigate } from 'react-router-dom';
const Item = (props) => {
    const navigator = useNavigate()
    const data = props.data;
    return (
        <div className="item" onClick={()=>{navigator(`/detail/${data.id}`)}}>
            <img src={data.coverImgUrl?data.coverImgUrl:data.picUrl} alt="" /> 
            <div>{ data.name }</div>
        </div>
    );
}

export default Item;
